﻿@model Nop.Admin.Models.XJ.MaintenanceModel
@using Nop.Web.Framework.Localization
@using Nop.Services.Security

@Html.ValidationSummary(true)
@Html.HiddenFor(model => model.Id)

<script>
    $(document).ready(function () {
        bindBootstrapTabSelectEvent('category-edit');
    });
</script>

<style type="text/css">
    .pic {
        width: 200px;
        height: 200px;
        object-fit: cover;
    }
</style>

<div class="content">
    <div class="form-horizontal">
        <div class="row">
            <div class="col-md-12 clearfix">
                <div class="pull-left">
                    @Html.Action("Mode", "Setting", new { modeName = "category-advanced-mode" })
                </div>
            </div>
        </div>
        <div id="category-edit" class="nav-tabs-custom">
            <ul class="nav nav-tabs">
                @Html.RenderBootstrapTabHeader("tab-info", new LocalizedString("基本信息"), true)
                @Html.RenderBootstrapTabHeader("tab-activitylog", @T("Admin.Customers.Customers.ActivityLog"))
            </ul>
            <div class="tab-content">
                @Html.RenderBootstrapTabContent("tab-info", @TabInfo(), true)
                @Html.RenderBootstrapTabContent("tab-activitylog", @TabActivityLog())
            </div>
        </div>
    </div>
</div>

@{
    //custom tabs
    var eventMessage = new AdminTabStripCreated(this.Html, "category-edit");
    EngineContext.Current.Resolve<IEventPublisher>().Publish(eventMessage);
    foreach (var eventBlock in eventMessage.BlocksToRender)
    {
        @eventBlock
    }
}

@*save selected tab name*@
<input type="hidden" id="selected-tab-name" name="selected-tab-name" value="@(Html.GetSelectedTabName())">

@helper TabInfo()
{
var permissionService = EngineContext.Current.Resolve<IPermissionService>();
var canManageInspectionPlansView = permissionService.Authorize(StandardPermissionProvider.ManageInspectionPlansView);
var canManageOutsEdit = permissionService.Authorize(StandardPermissionProvider.ManageOutsEdit);

    <div class="content">
        <div class="form-horizontal">
            <div class="panel-group">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.SNo)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.SNo)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.PNo)
                            </div>
                            <div class="col-md-9">
                                @if (canManageInspectionPlansView)
                                {
                                    <a target="_blank" href="@Url.Content("~/Admin/InspectionPlan/View/")@Model.InspectionPlanId">@Model.PNo</a>
                                }
                                else
                                {
                                    @Html.NopDisplayFor(model => model.PNo)
                                }
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.PlaceName)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.PlaceName)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.CategoryName)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.CategoryName)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.Comment)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.Comment)
                            </div>
                        </div>
                        <div class="form-group" style="height:34px;">
                            <div class="col-md-3">
                                <div class="label-wrapper"><label class="control-label" for="Pictures" title="">现场图片</label></div>
                            </div>
                            <div class="col-md-9">
                                @foreach (var item in Model.Pictures)
                                {
                                    <img src="@item" class="pic" />
                                }
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.DepartmentName)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.DepartmentName)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.CustomerName)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.CustomerName)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.CreatedOn)
                            </div>
                            <div class="col-md-9">
                                <div class="form-text-row">@Model.CreatedOn.ToString("yyyy-MM-dd HH:mm")</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.ResponsibleDepartmentName)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.ResponsibleDepartmentName)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.ResponsibleTeamName)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.ResponsibleTeamName)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.ResponsiblePersonName)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.ResponsiblePersonName)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.MaintenancePersonNames)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.MaintenancePersonNames)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.MaintenanceOn)
                            </div>
                            <div class="col-md-9">
                                <div class="form-text-row">@(Model.MaintenanceOn.HasValue?Model.MaintenanceOn.Value.ToString("yyyy-MM-dd HH:mm"):"")</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.HoursString)
                            </div>
                            <div class="col-md-9">
                                <div class="form-text-row">@(Model.HoursString)</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.Star)
                            </div>
                            <div class="col-md-9">
                                <div class="form-text-row">@(Model.Star > 0?(Model.Star + "分"):"")</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.Evaluation)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.Evaluation)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.IsAssign)
                            </div>
                            <div class="col-md-9">
                                <div class="form-text-row">@(Model.IsAssign ? "是":"")</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.AssignComment)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.AssignComment)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.IsExternal)
                            </div>
                            <div class="col-md-9">
                                <div class="form-text-row">@(Model.IsExternal?"是":"")</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.Total)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.Total)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                @Html.NopLabelFor(model => model.StateName)
                            </div>
                            <div class="col-md-9">
                                @Html.NopDisplayFor(model => model.StateName)
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="content" style="padding-top:0;">
        <div class="form-horizontal">
            <div class="panel-group">
                @if (Model.Id > 0)
                {
                    <div class="content-header clearfix" style="padding-top:0;">
                        <h1 class="pull-left">
                            维修设备
                        </h1>
                        <div class="pull-right">
                            @{if (Model.CanComplete)
                                {
                                    <button type="submit" id="btnAddNewEquipment"
                                            onclick="javascript: addDetail(); return false;"
                                            class="btn btn-primary">
                                        <i class="fa fa-plus"></i>
                                        添加
                                    </button>
                                }
                            }
                            <input type="submit" id="btnRefreshDetails" style="display: none" />
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-body">
                            @{
                                var defaultGridPageSize = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().DefaultGridPageSize;
                                var gridPageSizes = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().GridPageSizes;
                            }


                            <div id="details-grid"></div>

                            <script>
                                $(document).ready(function() {
                                    $("#details-grid").kendoGrid({
                                        dataSource: {
                                            type: "json",
                                            transport: {
                                                read: {
                                                    url: "@Html.Raw(Url.Action("Details", "Maintenance", new { maintenanceId = Model.Id}))",
                                                    type: "POST",
                                                    dataType: "json",
                                                    data: addAntiForgeryToken
                                                },
                                                destroy: {
                                                    url: "@Html.Raw(Url.Action("DetailDelete", "Maintenance", new { id = Model.Id }))",
                                                    type: "POST",
                                                    dataType: "json",
                                                    data: addAntiForgeryToken
                                                }
                                            },
                                            schema: {
                                                data: "Data",
                                                total: "Total",
                                                errors: "Errors",
                                                model: {
                                                    id: "Id",
                                                    fields: {
                                                        Name: { editable: false, type: "string" },
                                                        Manufacturer: { editable: false, type: "string" },
                                                        Specification: { editable: false, type: "string" },
                                                        Location: { editable: false, type: "string" },
                                                        Id: { editable: false, type: "number" }
                                                    }
                                                }
                                            },
                                            requestEnd: function(e) {
                                                if (e.type == "update") {
                                                    this.read();
                                                }
                                            },
                                            error: function(e) {
                                                display_kendoui_grid_error(e);
                                                // Cancel the changes
                                                this.cancelChanges();
                                            },
                                            pageSize: @(defaultGridPageSize),
                                            serverPaging: true,
                                            serverFiltering: true,
                                            serverSorting: true
                                        },
                                        pageable: {
                                            refresh: true,
                                            pageSizes: [@(gridPageSizes)],
                                            @Html.Partial("_GridPagerMessages")
                                        },
                                        editable: {
                                            confirmation: "@T("Admin.Common.DeleteConfirmation")",
                                            mode: "inline"
                                        },
                                        scrollable: false,
                                        columns: [{
                                                field: "Name",
                                                title: "名称",
                                                width: 300,
                                                headerAttributes: { style: "text-align:center" },
                                            }, {
                                                field: "Manufacturer",
                                                title: "品牌",
                                                width: 200,
                                                headerAttributes: { style: "text-align:center" },
                                            }, {
                                                field: "Specification",
                                                title: "规格型号",
                                                width: 300,
                                                headerAttributes: { style: "text-align:center" },
                                            }, {
                                                field: "Location",
                                                title: "具体位置",
                                                width: 300,
                                                headerAttributes: { style: "text-align:center" },
                                            },
                                        ]
                                    });
                                    $('#btnRefreshDetails').click(function () {
                                        //refresh grid
                                        var grid = $("#details-grid").data('kendoGrid');
                                        grid.dataSource.read();

                                        //return false to don't reload a page
                                        return false;
                                    });
                                });

                                function addDetail() {
                                    const w = $('.content-wrapper .content').eq(0).width();
                                    if (w > 0) {
                                        OpenWindow('@(Url.Action("EquipmentAddPopup", "Maintenance"))?maintenanceId=@Model.Id&btnId=btnRefreshDetails&formId=maintenance-form', w, 800, true);
                                    }
                                    else {
                                        OpenWindow('@(Url.Action("EquipmentAddPopup", "Maintenance"))?maintenanceId=@Model.Id&btnId=btnRefreshDetails&formId=maintenance-form', window.innerWidth, 800, true);
                                    }
                                }
                            </script>
                        </div>
                    </div>
                }
                else
                {
                    <div class="panel panel-default">
                        <div class="panel-body">
                            @T("Admin.Catalog.Categories.Products.SaveBeforeEdit")
                        </div>
                    </div>
                }
            </div>
        </div>
    </div>
    <div class="content" style="padding-top:0;">
        <div class="form-horizontal">
            <div class="panel-group">
                @if (Model.Id > 0)
                {
                    <div class="content-header clearfix" style="padding-top:0;">
                        <h1 class="pull-left">
                            领用记录
                        </h1>
                        <div class="pull-right">
                            @{if (Model.CanComplete && canManageOutsEdit)
                                {
                                    <a href="@Url.Action("Create","EquipmentStockOut", new {maintenanceId = Model.Id})" class="btn btn-primary">
                                        <i class="fa fa-plus"></i>
                                        @T("Admin.Common.AddNew")
                                    </a>
                                }
                            }
                            <input type="submit" id="btnRefreshStockOuts" style="display: none" />
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-body">
                            @{
                                var defaultGridPageSize = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().DefaultGridPageSize;
                                var gridPageSizes = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().GridPageSizes;
                            }


                            <div id="products-grid"></div>

                            <script>
                            $(document).ready(function() {
                                $("#products-grid").kendoGrid({
                                    dataSource: {
                                        type: "json",
                                        transport: {
                                            read: {
                                                url: "@Html.Raw(Url.Action("DetailList", "EquipmentStockOut", new { SearchMaintenanceId = Model.Id}))",
                                                type: "POST",
                                                dataType: "json",
                                                data: addAntiForgeryToken
                                            },
                                            destroy: {
                                                url: "@Html.Raw(Url.Action("DetailDelete", "EquipmentStockOut", new { id = Model.Id }))",
                                                type: "POST",
                                                dataType: "json",
                                                data: addAntiForgeryToken
                                            }
                                        },
                                        schema: {
                                            data: "Data",
                                            total: "Total",
                                            errors: "Errors",
                                            model: {
                                                id: "Id",
                                                fields: {
                                                    Name: { editable: false, type: "string" },
                                                    ProductionDate: { editable: false, type: "date" },
                                                    Published: { editable: true, type: "boolean" },
                                                    DisplayOrder: { editable: true, type: "number" },
                                                    Id: { editable: false, type: "number" }
                                                }
                                            }
                                        },
                                        requestEnd: function(e) {
                                            if (e.type == "update") {
                                                this.read();
                                            }
                                        },
                                        error: function(e) {
                                            display_kendoui_grid_error(e);
                                            // Cancel the changes
                                            this.cancelChanges();
                                        },
                                        pageSize: @(defaultGridPageSize),
                                        serverPaging: true,
                                        serverFiltering: true,
                                        serverSorting: true
                                    },
                                    pageable: {
                                        refresh: true,
                                        pageSizes: [@(gridPageSizes)],
                                        @Html.Partial("_GridPagerMessages")
                                    },
                                    editable: {
                                        confirmation: "@T("Admin.Common.DeleteConfirmation")",
                                        mode: "inline"
                                    },
                                    scrollable: false,
                                    columns: [{
                                            field: "SNo",
                                            title: "领用单号",
                                            width: 150,
                                            headerAttributes: { style: "text-align:center" },
                                        },{
                                            field: "Name",
                                            title: "名称",
                                            width: 300,
                                            headerAttributes: { style: "text-align:center" },
                                        }, {
                                            field: "Manufacturer",
                                            title: "品牌",
                                            width: 200,
                                            headerAttributes: { style: "text-align:center" },
                                        }, {
                                            field: "Specification",
                                            title: "规格型号",
                                            width: 300,
                                            headerAttributes: { style: "text-align:center" },
                                        }, {
                                            field: "Price",
                                            title: "价格",
                                            width: 100,
                                            headerAttributes: { style: "text-align:center" },
                                            attributes: { style: "text-align:right" },
                                            format: "{0:N2}",
                                        }, {
                                            field: "Amount",
                                            title: "数量",
                                            width: 100,
                                            headerAttributes: { style: "text-align:center" },
                                            attributes: { style: "text-align:right" },
                                            template: '#=Amount##=Unit#',
                                        }, {
                                            field: "StateName",
                                            title: "状态",
                                            width: 100,
                                            headerAttributes: { style: "text-align:center" },
                                            attributes: { style: "text-align:center" },
                                        }
                                    ]
                                });
                                $('#btnRefreshStockOuts').click(function () {
                                    //refresh grid
                                    var grid = $("#products-grid").data('kendoGrid');
                                    grid.dataSource.read();

                                    //return false to don't reload a page
                                    return false;
                                });
                            });
                            </script>
                        </div>
                    </div>
                }
                else
                {
                    <div class="panel panel-default">
                        <div class="panel-body">
                            @T("Admin.Catalog.Categories.Products.SaveBeforeEdit")
                        </div>
                    </div>
                }
            </div>
        </div>
    </div>
    <div class="content" style="padding-top:0;">
        <div class="form-horizontal">
            <div class="panel-group">
                @if (Model.Id > 0)
                {
                    <div class="content-header clearfix" style="padding-top:0;">
                        <h1 class="pull-left">
                            维修工时
                        </h1>
                        <div class="pull-right">
                            <input type="submit" id="btnRefreshSchedules" style="display: none" />
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-body">
                            @{
                                var defaultGridPageSize = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().DefaultGridPageSize;
                                var gridPageSizes = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().GridPageSizes;
                            }


                            <div id="schedules-grid"></div>

                            <script>
                                $(document).ready(function() {
                                    $("#schedules-grid").kendoGrid({
                                        dataSource: {
                                            type: "json",
                                            transport: {
                                                read: {
                                                    url: "@Html.Raw(Url.Action("Schedules", "Maintenance", new { maintenanceId = Model.Id}))",
                                                    type: "POST",
                                                    dataType: "json",
                                                    data: addAntiForgeryToken
                                                },
                                                destroy: {
                                                    url: "@Html.Raw(Url.Action("ScheduleDelete", "Maintenance", new { id = Model.Id }))",
                                                    type: "POST",
                                                    dataType: "json",
                                                    data: addAntiForgeryToken
                                                }
                                            },
                                            schema: {
                                                data: "Data",
                                                total: "Total",
                                                errors: "Errors",
                                                model: {
                                                    id: "Id",
                                                    fields: {
                                                        StartOn: { editable: false, type: "date" },
                                                        StartCustomer: { editable: false, type: "string" },
                                                        EndOn: { editable: false, type: "date" },
                                                        EndCustomer: { editable: false, type: "string" },
                                                        Minutes: { editable: false, type: "number" },
                                                        Comment: { editable: false, type: "string" },
                                                        Id: { editable: false, type: "number" }
                                                    }
                                                }
                                            },
                                            requestEnd: function (e) {
                                                if (e.type == "read") {
                                                    var response = e.response;
                                                    if (response) {
                                                        //store extra data
                                                        reportE = e.response["ExtraData"];
                                                    }
                                                }
                                                if (e.type == "update") {
                                                    this.read();
                                                }
                                            },
                                            error: function(e) {
                                                display_kendoui_grid_error(e);
                                                // Cancel the changes
                                                this.cancelChanges();
                                            },
                                            pageSize: @(defaultGridPageSize),
                                            serverPaging: true,
                                            serverFiltering: true,
                                            serverSorting: true
                                        },
                                        pageable: {
                                            refresh: true,
                                            pageSizes: [@(gridPageSizes)],
                                            @Html.Partial("_GridPagerMessages")
                                        },
                                        editable: {
                                            confirmation: "@T("Admin.Common.DeleteConfirmation")",
                                            mode: "inline"
                                        },
                                        scrollable: false,
                                        dataBound: onDataBoundE,
                                        columns: [{
                                                field: "StartOn",
                                                title: "开始时间",
                                                width: 120,
                                                type: "date",
                                                format: "{0:yy/MM/dd HH:mm}",
                                                headerAttributes: { style: "text-align:center" },
                                                attributes: { style: "text-align:center" },
                                            }, {
                                                field: "StartCustomer",
                                                title: "开始操作人",
                                                width: 100,
                                                headerAttributes: { style: "text-align:center" },
                                                attributes: { style: "text-align:center" },
                                            },  {
                                                field: "EndOn",
                                                title: "截止时间",
                                                width: 120,
                                                type: "date",
                                                format: "{0:yy/MM/dd HH:mm}",
                                                headerAttributes: { style: "text-align:center" },
                                                attributes: { style: "text-align:center" },
                                            }, {
                                                field: "EndCustomer",
                                                title: "截止操作人",
                                                width: 100,
                                                headerAttributes: { style: "text-align:center" },  
                                                attributes: { style: "text-align:center" },
                                            }, {
                                                field: "Minutes",
                                                title: "工时（分）",
                                                width: 100,
                                                headerAttributes: { style: "text-align:center" },
                                                attributes: { style: "text-align:right" },  
                                                footerTemplate: '<div style="text-align:right;"><span id=\"e-total-minutes\"></span></div>'
                                            },{
                                                field: "Comment",
                                                title: "截止说明",
                                                width: 300,
                                                headerAttributes: { style: "text-align:center" },
                                            }, 
                                        ]
                                    });
                                    $('#btnRefreshSchedules').click(function () {
                                        //refresh grid
                                        var grid = $("#schedules-grid").data('kendoGrid');
                                        grid.dataSource.read();

                                        //return false to don't reload a page
                                        return false;
                                    });
                                });
                                function onDataBoundE(e) {
                                    //update order totals summary
                                    if (reportE != "") {
                                        $('#e-total-minutes').text(reportE['Minutes']);
                                    }
                                }
                            </script>
                        </div>
                    </div>
                }
                else
                {
                    <div class="panel panel-default">
                        <div class="panel-body">
                            @T("Admin.Catalog.Categories.Products.SaveBeforeEdit")
                        </div>
                    </div>
                }
            </div>
        </div>
    </div>

}
@helper TabActivityLog()
{
    var defaultGridPageSize = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().DefaultGridPageSize;
    var gridPageSizes = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().GridPageSizes;

    <div class="panel-group">
        <div class="panel panel-default">
            <div class="panel-body">
                <div id="activitylog-grid"></div>
                <input type="submit" id="btnRefreshComments" style="display: none" />

                <script>
                    $(document).ready(function () {
                        $("#activitylog-grid").kendoGrid({
                            dataSource: {
                                type: "json",
                                transport: {
                                    read: {
                                        url: "@Html.Raw(Url.Action("CommentList", "Maintenance", new { SearchMaintenanceId = Model.Id}))",
                                        type: "POST",
                                        dataType: "json",
                                        data: addAntiForgeryToken
                                    }
                                },
                                schema: {
                                    data: "Data",
                                    total: "Total",
                                    errors: "Errors"
                                },
                                error: function(e) {
                                    display_kendoui_grid_error(e);
                                    // Cancel the changes
                                    this.cancelChanges();
                                },
                                pageSize: @(defaultGridPageSize),
                                serverPaging: true,
                                serverFiltering: true,
                                serverSorting: true
                            },
                            pageable: {
                                refresh: true,
                                pageSizes: [@(gridPageSizes)],
                                @Html.Partial("_GridPagerMessages")
                            },
                            editable: {
                                confirmation: "@T("Admin.Common.DeleteConfirmation")",
                                mode: "inline"
                            },
                            scrollable: false,
                            columns: [{
                                field: "TypeName",
                                title: "类型",
                                width: 300,
                                headerAttributes: { style: "text-align:center" },
                                attributes: { style: "text-align:center" },
                            }, {
                                field: "Comment",
                                title: "@T("Admin.Customers.Customers.ActivityLog.Comment")"
                            }, {
                                field: "Star",
                                title: "评分",
                                width: 100,
                                headerAttributes: { style: "text-align:center" },
                                attributes: { style: "text-align:center" },
                            }, {
                                field: "CustomerName",
                                title: "创建人",
                                width: 80,
                                headerAttributes: { style: "text-align:center" },
                                attributes: { style: "text-align:center" },
                             },  {
                                field: "CreatedOn",
                                title: "创建时间",
                                width: 200,
                                type: "date",
                                format: "{0:yyyy/MM/dd HH:mm:ss}",
                                headerAttributes: { style: "text-align:center" },
                                attributes: { style: "text-align:center" },
                            }]
                        });
                        $('#btnRefreshComments').click(function () {
                            //refresh grid
                            //var grid = $("#activitylog-grid").data('kendoGrid');
                            //grid.dataSource.read();
                            location.reload();

                            //return false to don't reload a page
                            return false;
                        });
                    });
                </script>
            </div>
        </div>
    </div>
}
